﻿#pragma once

#include <learn/ais/ais_object.h>
#include <learn/alg/alg_sampler.h>
#include <learn/geom/geom_surface.h>
#include <learn/mesh/mesh.h>

namespace xi
{

namespace ais
{

using namespace xi::mesh;

class EXT_SYMBOL AIS_Surface : public AIS_Object
{
  public:
    AIS_Surface(AIS_Surface &&) = delete;

    /**
     * @brief 指针构造
     *
     * @param[in] surface
     */
    explicit AIS_Surface(std::shared_ptr<Geom_Surface<3>> surface);

    /**
     * @brief 获得曲面
     *
     * @return std::shared_ptr<Geom_Surface<3>>
     */
    std::shared_ptr<Geom_Surface<3>> surface() const;

    /**
     * @brief 曲面采样
     *
     * @param[in] num
     * @return Mesh_Data
     */
    Mesh_Data sample(std::size_t num) const;

    /**
     * @brief 初始化消息
     *
     * @param[in] msg
     */
    void visit(AIS_InitMsg *msg) override;

  protected:
    std::shared_ptr<Geom_Surface<3>> m_surface;
    std::shared_ptr<alg::Alg_Sampler> m_sampler;
};

} // namespace ais

} // namespace xi
